<?php
/**
 * @fileoverview    动态加载的公共类
 * @author          xinhua
 * @date            Feb  02 11:31:49 CST 2012
 * @copyright       sina meila
 */


abstract class scroll_public extends ml_controller{



    protected $_pagenum=1;//页数
    protected $_offset=1;//每页的动态加载偏移量
    protected $_begin;
    protected $_offset_array=array(1,2,3);//最多滚2次屏幕
    protected $_uid;
    protected $ifme;
    
    public function initParam()    {

        $this->_pagenum = intval($this->input('page','G'));//页数
        if($this->_pagenum==0)$this->_pagenum=1;//默认1
        $this->_offset = intval($this->input('segment','G'));
        if($this->_offset==0)$this->_offset=1;//默认1
        $this->_begin=($this->_pagenum-1)* (ML_FEED_PAGESIZE * 3)+($this->_offset-1)*ML_FEED_PAGESIZE;
        
        $this->_uid =$this->__owner['uid']= intval($this->input('uid','G'));//获取被查看人的uid
        $this->ifme=$this->__visitor['uid']==$this->_uid?true:false;//是否查看本人

    }

    public function checkParam() {
        $this->check_referer();
        if($this->_pagenum<0||!in_array($this->_offset, $this->_offset_array)){
            $this->api_output(ML_RCODE_PARAM,'',"参数不正确");
            exit();
        }
    }

}

?>